var http = require('http')
var fs = require('fs')
http.createServer(function (resquest, response){
    if (resquest.url !== '/favicon.ico') {
        response.writeHead(200, { 'Content-Type': 'text/html;charset=UTF-8'})
        console.log(resquest.url)
        let fsLogin = ''
        switch (resquest.url) {
            case '/':
                fsLogin = fs.readFileSync('fs.html', 'UTF-8')
                break
            case '/login':
                fsLogin = fs.readFileSync('./vive/login.html', 'UTF-8')
                break
            case '/reg':
                fsLogin = fs.readFileSync('./vive/reg.html', 'UTF-8')
                break
            default:
                fsLogin = fs.readFileSync('./vive/404.html', 'UTF-8')
        }
        response.write(fsLogin)
        response.end()
    }
}).listen(520)